package se.sics.drsm.model;

import java.io.Serializable;
import java.util.List;

/**
 * The <code>DRSMConfiguration</code> class.
 *
 * @author Shadid Chowdhury <msrch@kth.se>
 */
public class StateMachineConfiguration implements Serializable {

    private final DRSMAddress leader;
    private final List<DRSMAddress> peerList;
    private final DRSMAddress addedPeer;
    private final DRSMAddress removedPeer;

    public StateMachineConfiguration(DRSMAddress leader, List<DRSMAddress> peerList, DRSMAddress addedPeer,
                                     DRSMAddress removedPeer) {
        this.leader = leader;
        this.peerList = peerList;
        this.addedPeer = addedPeer;
        this.removedPeer = removedPeer;
    }

    public DRSMAddress getLeader() {
        return leader;
    }

    public List<DRSMAddress> getPeerList() {
        return peerList;
    }

    public DRSMAddress getAddedPeer() {
        return addedPeer;
    }

    public DRSMAddress getRemovedPeer() {
        return removedPeer;
    }

    @Override
    public String toString() {
        return "StateMachineConfiguration{" +
                "leader=" + leader +
                ", peerList=" + peerList +
                ", addedPeer=" + addedPeer +
                ", removedPeer=" + removedPeer +
                '}';
    }
}
